package cultu.supplier.service;

import org.granite.messaging.service.annotations.RemoteDestination;

import cultu.core.message.Context;
import cultu.supplier.message.Product;
import cultu.supplier.message.ProductCriteria;
import cultu.supplier.message.ProductList;
import cultu.supplier.message.ProductScenario;

/**
 * The Interface ProductManager.
 */
@RemoteDestination(id="productManager",channel="my-amf")
public interface ProductManager
{
  
  /**
   * Gets the product.
   *
   * @param pContext the context
   * @param pScenario the scenario
   * @param pProduct the product
   * @return the product
   */
  Product getProduct(Context pContext, ProductScenario pScenario, Product pProduct);

  /**
   * Creates the product.
   *
   * @param pContext the context
   * @param pScenario the scenario
   * @param pProduct the product
   * @return the product
   */
  Product createProduct(Context pContext, ProductScenario pScenario, Product pProduct);

  /**
   * Delete product.
   *
   * @param pContext the context
   * @param pScenario the scenario
   * @param pProduct the product
   * @return the product
   */
  Product deleteProduct(Context pContext, ProductScenario pScenario, Product pProduct);

  /**
   * Update product.
   *
   * @param pContext the context
   * @param pScenario the scenario
   * @param pProduct the product
   * @return the product
   */
  Product updateProduct(Context pContext, ProductScenario pScenario, Product pProduct);

  /**
   * Find products.
   *
   * @param pContext the context
   * @param pScenario the scenario
   * @param pCriteria the criteria
   * @return the product list
   */
  ProductList findProducts(Context pContext, ProductScenario pScenario, ProductCriteria pCriteria);

  /**
   * Delete products.
   *
   * @param pContext the context
   * @param pScenario the scenario
   * @param pList the list
   * @return the product list
   */
  ProductList deleteProducts(Context pContext, ProductScenario pScenario, ProductList pList);

  /**
   * Creates the products.
   *
   * @param pContext the context
   * @param pScenario the scenario
   * @param pList the list
   * @return the product list
   */
  ProductList createProducts(Context pContext, ProductScenario pScenario, ProductList pList);

  /**
   * Update products.
   *
   * @param pContext the context
   * @param pScenario the scenario
   * @param pList the list
   * @return the product list
   */
  ProductList updateProducts(Context pContext, ProductScenario pScenario, ProductList pList);

  /**
   * Find products with native query.
   * @param pContext the context.
   * @param pScenario the scenario.
   * @param pCriteria the criteria.
   * @return
   */
  ProductList findProductsNative(Context pContext, ProductScenario pScenario, ProductCriteria pCriteria);

  /**
   * increaseBuytimes
   * @param productId
   */
  public void increaseBuytimes(final Long productId);

  /**
   * increaseConsultationtimes
   * @param productId
   */
  public void increaseConsultationtimes(final Long productId);
}
